package sample;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

@XmlRootElement(name = "game")
public class WrapperSudoku {
    @XmlElement(name = "generation")
    private int generation;

    @XmlTransient
    public void setGeneration(int generation){
        this.generation = generation;
    }

    public int getGeneration(){
        return generation;
    }


    @XmlElement(name = "grid")
    private int[][] grid;

    @XmlTransient
    public void setGrids(int[][] grid){
        this.grid = new int[9][9];
        int i = 0;
        for (int[] a:grid){
            for (int j = 0;j < 9;j ++){
                this.grid[i][j] = a[j];
            }i ++;
        }
    }

    public int[][] getGrids(){
        int[][] grid = new int[9][9];
        for(int i = 0;i < 9;i ++){
            for (int j = 0;j < 9;j ++){
                grid[i][j] = this.grid[i][j];
            }
        }return grid;
    }

}
